package com.eastfair.imaster.entity;

import cn.afterturn.easypoi.excel.annotation.Excel;
import cn.afterturn.easypoi.excel.annotation.ExcelEntity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.eastfair.core.base.entity.Entity;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.time.LocalDateTime;
import java.util.HashMap;
import java.util.Map;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.ToString;
import lombok.experimental.Accessors;
import static com.eastfair.core.utils.DateUtils.DEFAULT_DATE_TIME_FORMAT;
import com.eastfair.annotation.model.EchoVO;

import static com.baomidou.mybatisplus.annotation.SqlCondition.LIKE;

/**
 * <p>
 * 实体类
 * 客户池操作记录表
 * </p>
 *
 * @author liuxiaobai
 * @since 2021-11-15
 */
@Data
@NoArgsConstructor
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("i_customer_pool_logs")
@ApiModel(value = "CustomerPoolLogs", description = "客户池操作记录表")
@AllArgsConstructor
public class CustomerPoolLogs extends Entity<Long> implements EchoVO {

    private static final long serialVersionUID = 1L;
    @TableField(exist = false)
    private Map<String, Object> echoMap = new HashMap<>();
    /**
     * 项目ID
     */
    @ApiModelProperty(value = "项目ID")
    @TableField(value = "project_id")
    @Excel(name = "项目ID")
    private Long projectId;

    /**
     * 展会ID
     */
    @ApiModelProperty(value = "展会ID")
    @TableField(value = "exhibition_id")
    @Excel(name = "展会ID")
    private Long exhibitionId;

    /**
     * 公司ID
     */
    @ApiModelProperty(value = "公司ID")
    @TableField(value = "company_id")
    @Excel(name = "公司ID")
    private Long companyId;

    /**
     * 客户池ID
     */
    @ApiModelProperty(value = "客户池ID")
    @TableField(value = "pool_id")
    @Excel(name = "客户池ID")
    private Long poolId;

    /**
     * 操作人ID user_account
     */
    @ApiModelProperty(value = "操作人ID user_account")
    @TableField(value = "operator_id")
    @Excel(name = "操作人ID user_account")
    private Long operatorId;

    /**
     * 操作人姓名
     */
    @ApiModelProperty(value = "操作人姓名")
    @Size(max = 32, message = "操作人姓名长度不能超过32")
    @TableField(value = "operator_name", condition = LIKE)
    @Excel(name = "操作人姓名")
    private String operatorName;

    /**
     * 被分配人ID user_account
     */
    @ApiModelProperty(value = "被分配人ID user_account")
    @TableField(value = "distribution_id")
    @Excel(name = "被分配人ID user_account")
    private Long distributionId;

    /**
     * 被分配人姓名
     */
    @ApiModelProperty(value = "被分配人姓名")
    @Size(max = 32, message = "被分配人姓名长度不能超过32")
    @TableField(value = "distribution_name", condition = LIKE)
    @Excel(name = "被分配人姓名")
    private String distributionName;

    /**
     * 事件类型（NEW-添加 DISTRIBUTION-分配 UNBOUND-解绑）
     */
    @ApiModelProperty(value = "事件类型（NEW-添加 DISTRIBUTION-分配 UNBOUND-解绑）")
    @Size(max = 32, message = "事件类型（NEW-添加 DISTRIBUTION-分配 UNBOUND-解绑）长度不能超过32")
    @TableField(value = "event_type", condition = LIKE)
    @Excel(name = "事件类型（NEW-添加 DISTRIBUTION-分配 UNBOUND-解绑）")
    private String eventType;


    @Builder
    public CustomerPoolLogs(Long id, LocalDateTime createTime, 
                    Long projectId, Long exhibitionId, Long companyId, Long poolId, Long operatorId, 
                    String operatorName, Long distributionId, String distributionName, String eventType) {
        this.id = id;
        this.createTime = createTime;
        this.projectId = projectId;
        this.exhibitionId = exhibitionId;
        this.companyId = companyId;
        this.poolId = poolId;
        this.operatorId = operatorId;
        this.operatorName = operatorName;
        this.distributionId = distributionId;
        this.distributionName = distributionName;
        this.eventType = eventType;
    }

}
